﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class UICodeUtils
{
  public  static string GenerateCode(WindowData window)
    {
        StringBuilder code = new StringBuilder();
        code.Append("using System;\nusing UnityEngine;\nusing System.Collections.Generic;\nusing ResourceSystem;\n\n");
        code.Append("public class ");
        code.Append(window.PrefabName);
        code.Append(":WindowBase\n{");
        code.Append("     \n    /// <summary>     \n    ///初始化界面     \n    /// </summary>\n");
        code.Append("    public override void InitWidget()\n    {\n    }");
        code.Append("     \n    /// <summary>     \n    ///当界面隐藏的时候     \n    /// </summary>\n");
        code.Append("    public override void OnHide()\n    {\n    }");
        code.Append("     \n    /// <summary>     \n    ///当界面显示的时候     \n    /// </summary>\n");
        code.Append("    public override void OnShow()\n    {\n    }");
        code.Append("     \n    /// <summary>     \n    ///刷新界面     \n    /// </summary>\n");
        code.Append("    public override void RefreshWindow()\n    {\n    }");
        code.Append("     \n    /// <summary>     \n    ///注册监听     \n    /// </summary>\n");
        code.Append("    public override void RegisterListener()\n    {\n    }");
        code.Append("     \n    /// <summary>     \n    ///释放窗体     \n    /// </summary>\n");
        code.Append("    public override void ReleaseWidget()\n    {\n    }");
        code.Append("     \n    /// <summary>     \n    ///移除监听     \n    /// </summary>\n");
        code.Append("    public override void Removelistener()\n    {\n    }");
        code.Append("\n}");
        return code.ToString();
    }
}
